<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateContractTransactionsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('contract_transactions', function (Blueprint $table) {
            $table->increments('id');
            $table->string('blockNumber')->nullable();
            $table->unsignedBigInteger('timeStamp')->default(0);
            $table->string('hash')->nullable();
            $table->integer('nonce')->default(0);
            $table->string('blockHash')->nullable();
            $table->string('tokenName')->nullable();
            $table->string('tokenSymbol')->nullable();
            $table->string('tokenDecimal')->nullable();
            $table->integer('transactionIndex')->default(0);
            $table->string('from')->nullable();
            $table->string('to')->nullable();
            $table->string('value')->nullable();
            $table->integer('gas')->default(0);
            $table->bigInteger('gasPrice')->default(0);
            $table->text('input')->nullable();
            $table->string('contractAddress')->nullable();
            $table->bigInteger('cumulativeGasUsed')->default(0);
            $table->bigInteger('gasUsed')->default(0);
            $table->integer('confirmations')->default(0);
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('contract_transactions');
    }
}
